package org.agile4j.patterns.command.pc;

public class Client {
	public void assemble() {
		// 1:　把命令和真正的实现组合起来，相当于组装机器
		//把机箱上按钮的连接线插在主板上
		MainBoardApi mainBorad = new MsiMainBoard() ;
		Command openCommand = new OpenCommand(mainBorad) ;
		Command resetCommand = new ResetCommand(mainBorad) ;
		// 2: 为机箱上的按钮设置对应的命令, 让按钮知道该干什么 
		Box box = new Box() ;
		box.setOpenCommand(openCommand);
		box.setResetCommand(resetCommand);
		// 3: 然后模拟按下机箱的按钮
		System.out.println("按下开机按钮!!!!");
		box.openButtonPressed();
		System.out.println("按下重启按钮!!!!");
		box.resetButtonPressessed();
		
	}
}
